package entity

import "time"

// EnvConfig 结构体对应数据库表 `env_configs`
type EnvConfig struct {
	ID                int        `gorm:"primaryKey;autoIncrement" json:"id"`
	Env               string     `gorm:"size:100;not null;unique" json:"env"`
	ClusterName       string     `gorm:"size:255;not null" json:"cluster_name"`
	DescriptionCN     string     `gorm:"size:255;not null" json:"description_cn"`
	HarborURL         string     `gorm:"size:255;not null" json:"harbor_url"`
	HarborProjectName string     `gorm:"size:255;not null" json:"harbor_project_name"`
	NodeVersion       string     `gorm:"size:255;not null" json:"node_version"`
	MavenVersion      string     `gorm:"size:255;not null" json:"maven_version"`
	CreatedAt         time.Time  `gorm:"type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt         time.Time  `gorm:"type:timestamp;not null;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt         *time.Time `gorm:"type:timestamp;default:null" json:"deleted_at"`
}

// TableName 指定数据库表名（可选）
func (EnvConfig) TableName() string {
	return "env_configs"
}
